export default function debounce(fn, wait) {
    let timeout = null
    return function() {
        if (timeout) clearTimeout(timeout)
        let context = this
        let args = [...arguments]
        timeout = setTimeout(() => {
            fn.apply(context, args)
        }, wait);
    }
}